#ifndef _LEVEL_H_
#define _LEVEL_H_

typedef struct
{
    unsigned int tileset1;		//compressed tilemap data
	unsigned int mapoffset;	    //map data
	unsigned int tileset2;      //collision data
	unsigned int tileset3;		//tile graphics data
	unsigned int bgpal;
	unsigned int fgpal;
	unsigned int reserved;
	unsigned short monster_ptr;
	unsigned short victim_ptr;
	unsigned short item_ptr;
	unsigned short width;
	unsigned short height;
	unsigned short tileset4;
	unsigned short reserved2;
	unsigned short player1_x;
	unsigned short player1_y;
	unsigned short player2_x;
	unsigned short player2_y;
	unsigned short music;
	unsigned short reserved3;
	unsigned short title1_ptr;
	unsigned short title2_ptr;
	unsigned short bonus_ptr;
}__attribute__((__packed__)) level_t;


// level and map sizes
extern level_t level;
extern unsigned int mapsize;
extern unsigned char *mapdata;

unsigned int mapoffset(int n);
void readlevel(int n);
void readmap();
char *getlevelname();

#endif